<!DOCTYPE html>
<html xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<!--</div>-->
<div id="app1">
    <button v-on:click="sayHi" >按钮</button>
</div>
<!--导入Vue.js-->
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script>

    var ifa=  new Vue({
        // 元素
        el:"#app1",
        data:{
            message:"helo,Vue",
            // 定义一个数组
            items:[{message:"刘恒"},{message:"通研2202"},{message:"图像处理"}]
        },
        methods:{//方法必须定义在Vue的Method对象中
            sayHi:function () {
                alert(this.message)
            }

        }
    });
</script>
</body>
</html>
